<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Ohne_Titel_1</title>
</head>

<body>

<?php

session_start(); 


?>


<?php

//Aktueller Wert aus Draggable in Datenbank

if (!isset($_POST['dragpositiontop']))
{
$_POST['dragpositiontop'] = "";
}

if (!isset($_POST['dragpositionleft']))
{
$_POST['dragpositionleft'] = "";
}


$CurPosTop = $_POST['dragpositiontop'];
$CurPosLeft = $_POST['dragpositionleft'];



$verbindung = mysql_connect("localhost", "root" , "") 
or die("Verbindung zur Datenbank konnte nicht hergestellt werden"); 
mysql_select_db("Timetable") or die ("Datenbank konnte nicht ausgewählt werden"); 

$username = $_SESSION["username"];


$eintrag = "update user set PositionTop ='$CurPosTop' ,PositionLeft ='$CurPosLeft' where username ='$username'";
mysql_query($eintrag);




if (isset($_POST['Speichern']))
{
header("Location: timetable.php");
}





?>





</body>

</html>
